package com.edisoncgh.service.impl;

import com.edisoncgh.mapper.ArticleMapper;
import com.edisoncgh.pojo.Article;
import com.edisoncgh.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleServiceImpl implements ArticleService {
    @Autowired
    private ArticleMapper articleMapper;

    @Override
    public int deleteById(Integer id) {
        return articleMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<Article> findall() {
        return articleMapper.findall();
    }

    @Override
    public boolean insertArticle(Article article) {
        return articleMapper.insert(article) > 0;
    }

    @Override
    public Article selectById(Integer id) {
        return articleMapper.selectByPrimaryKey(id);
    }


//    @Override
//    public List<Article> selectArticleWithTagAndCategory() {
//        return articleMapper.selectArticleWithTagAndCategory();
//    }
}
